package job.sxf;
import java.util.*;

public class sxf1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        char[] stones = new char[n];
        in.nextLine();
        String s = in.nextLine();
        for (int i = 0; i < s.length(); i++){
            stones[i] = s.charAt(i);
        }
        int count = 0;
        for (int i = 1; i < n; i++){
            if (stones[i] == stones[i - 1]){
                stones[i] = 'N';
            }
        }
        for (int i = 1; i < n; i++){
            if (stones[i] == 'N'){
                count ++;
            }
        }
        System.out.println(count);
    }
}
